<?php

class Ea_model extends CI_Model
{

    function insert($row = array())
    {

        $this->db->insert('estudios_analisis', $row);
        return $this->db->insert_id();
    }

    function find($id_cirugia)
    {
        $query = sprintf("select * from estudios_analisis where id_cirugia=%s", $id_cirugia);
        $row = $this->db->query($query);
        return $row;
    }

    function select()
    {
        $query = "select * from estudios_analisis";
        $rows = $this->db->query($query);
        $rows = $rows->result_array();
        return $rows;
    }

    function update($id, $row = array())
    {
        $this->db->where('id_cirugia', $id);
        $this->db->update('estudios_analisis', $row);
    }

    function delete($id_cirugia)
    {
        $query = sprintf("delete from estudios_analisis where id_cirugia=%s", $id_cirugia);
        $this->db->query($query);
    }
    
    

}

?>